package com.aiwiown.face.request;

import com.aiwiown.face.ApiMethod;
import com.aiwiown.face.ApiObject;
import com.aiwiown.face.ApiRequest;
import com.aiwiown.face.internal.util.RequestParamUtils;
import com.aiwiown.face.response.RawValidateVideoResponse;

import java.util.Map;

/**
 * <pre>
 *
 * 通过语音识别、唇语识别的方式来进行自拍视频的活体验证。
 *
 * 此API必须在使用同一个API key调用的Raw-GetRandomNumber API返回的token_random_number作为参数，否则返回400（INVALID_TOKEN）。
 *
 * 仅当appkey有使用网页KYC验证API服务的视频验证权限时，才可以调用此API，否则返回错误码 403（AUTHORIZATION_ERROR:Denied）。'
 *
 * https://faceid.com/pages/documents/7775631
 * </pre>
 * RawValidateVideoRequest
 * Date: 2020/5/12 0012
 * Time: 13:54
 *
 * @author tang.xiaosheng@qq.com
 */
public class RawValidateVideoRequest implements ApiRequest<RawValidateVideoResponse> {

    private static String apiUrl = "/lite/raw/validate_video";

    private String bizContent;
    private ApiObject bizModel = null;


    @Override
    public ApiMethod getApiMethod() {
        return ApiMethod.POST;
    }

    @Override
    public String getApiUrl() {
        return apiUrl;
    }

    @Override
    public Map<String, String> getTextParams() throws IllegalAccessException {
        return RequestParamUtils.getTextParams(this.bizModel);
    }

    @Override
    public Map<String, byte[]> getByteArrayParams() throws IllegalAccessException {
        return RequestParamUtils.getByteArrayParams(this.bizModel);
    }

    @Override
    public String getApiVersion() {
        return null;
    }

    @Override
    public Class<RawValidateVideoResponse> getResponseClass() {
        return RawValidateVideoResponse.class;
    }

    @Override
    public String getBizContent() {
        return this.bizContent;
    }

    public void setBizModel(ApiObject bizModel) {
        this.bizModel = bizModel;
    }

    @Override
    public String signVersion() {
        return null;
    }

    @Override
    public String getSignInfo(String apiKey, String secretKey) throws Exception {
        return null;
    }
}
